package thread;

public class ThreadInfoDemo {
    public static void main(String[] args) {
        Thread main = Thread.currentThread(); //获取主线程
        System.out.println(main);
        dosome();
    }
    public static void dosome(){
        Thread t = Thread.currentThread();
        System.out.println("运行dosome方法的线程："+t);
        System.out.println("线程的名字："+t.getName());
        System.out.println("线程的唯一标识："+t.getId());
        System.out.println("线程的优先级："+t.getPriority());
        System.out.println("线程是否还活着："+t.isAlive());
        System.out.println("线程是否为守护线程："+t.isDaemon());
        System.out.println("线程是否被中断："+t.isInterrupted());
    }
}
